########################
# Hucow related events #
########################

namespace = DWCMHucow


# .100 Start research on Lacteria Mirifica
narrative_event = {
	id = DWCMHucow.100
	desc = "DWCMHucow100_desc"
	picture = lacteria_research
	title = "dwcm_lacteria_research_title"
	
	ai = no	
	only_playable = yes # only playable characters get this
	min_age =  16
	capable_only = yes
	prisoner = no
	
 	trigger = {
		NOT = { has_character_flag = dwcm_lacteria_search_paused_01 }
		NOT = { has_character_flag = dwcm_lacteria_research_started }
		NOT = { has_character_flag = dwcm_lacteria_research_aborted }
		NOT = { has_character_flag = dwcm_lacteria_research_completed }
		OR = {
			has_valid_alchemist = yes # Calls a scripted_trigger from DW
			lf_has_potions = yes # LF
		}
		OR = { # Need to have some interest in plant studies or research in general
			has_focus = focus_scholarship
			trait = gardener
			trait = mystic
			trait = scholar
			trait = erudite
			trait = physician
			# Audax Validator "." Ignore_1006
			trait = dz_herbalist # Only matters if DroZzhat's Mod is present
		}
	}

	mean_time_to_happen = {
		months = 6
	}	
	
	option = {
		name = "DWCMHucow100A" # I shall discover more about this mysterious mushroom
		set_character_flag = dwcm_lacteria_research_started
		hidden_tooltip = { narrative_event = { id = DWCMHucow.110 days = 90  random = 30 } }
	}
	option = {
		name = "DWCMHucow100B" # Continue later [PAUSE EVENT CHAIN]
		set_character_flag = dwcm_lacteria_search_paused_01
	}
	option = {
		name = "DWCMHucow100C"  # No, I have no time to waste with this [STOP EVENT CHAIN]
		set_character_flag = dwcm_lacteria_research_aborted
		#TODO add tooltip to inform player that it will stop the event chain
	}
}


# .110 progress on Lacteria Mirifica research
narrative_event = {
	id = DWCMHucow.110
	desc = "DWCMHucow110_desc"
	picture = lacteria_research_01
	title = "dwcm_lacteria_research_title"
	
	hide_from = yes
	is_triggered_only = yes
	
	immediate = {
		dwcm_get_lacteria_test_subject = yes
	}

	option = { # Test Lacteria on self
		name = "DWCMHucow110A" 
		trigger = {
			is_female = yes
		}
		hidden_tooltip = { narrative_event = { id = DWCMHucow.120 } }
	}
	option = { # Try to find a willing test subject in your court
		name = "DWCMHucow110B" 
		trigger = {
			event_target:dwcm_lacteria_test_subject = { character = yes } # A check to see if there was a character successfully slotted into the position
		}
		hidden_tooltip = { narrative_event = { id = DWCMHucow.130 } }
	}
	option = { # Continue later [PAUSE EVENT CHAIN]
		name = "DWCMHucow110C" 
		set_character_flag = dwcm_lacteria_search_paused_02
	}
}


#.120 Test Lacteria Mirifica on self
narrative_event = {
	id = DWCMHucow.120
  	desc = "DWCMHucow120_desc"
  	picture = lacteria_research_02
  	title = "dwcm_lacteria_research_title"

  	is_triggered_only = yes

  	option = {
	  	name = "DWCMHucow120A" # Well, that was intense
	  	hidden_tooltip = { narrative_event = { id = DWCMHucow.140 days = 90  random = 30 } }
		if = {
			limit = { trait = hucow }
			hidden_tooltip = { 
				dwcm_raise_milk_production_MULTIPLIER_5 = yes
				dwcm_update_milk_production_rate_TOTAL = yes
				set_variable = { which = dwcm_milk_quantity_CURRENT which = dwcm_milk_capacity_TOTAL }
			}
		}
  	}
}


#.130 Test Lacteria Mirifica on a test subject
narrative_event = { 
  	id = DWCMHucow.130
	desc = "DWCMHucow130_desc"
	picture = lacteria_research_03
	title = "dwcm_lacteria_research_title"

	is_triggered_only = yes

	option = {
		name = "DWCMHucow130A" # Takes note on how the subject reacts
		hidden_tooltip = { narrative_event = { id = DWCMHucow.140 days = 90  random = 30 } }
		if = {
			limit = { trait = hucow }
			hidden_tooltip = { 
				dwcm_raise_milk_production_MULTIPLIER_5 = yes
				dwcm_update_milk_production_rate_TOTAL = yes
				set_variable = { which = dwcm_milk_quantity_CURRENT which = dwcm_milk_capacity_TOTAL }
			}
		}
	}
}


#.140 Analyse data + Idea for creating a more potent version
narrative_event = {
  	id = DWCMHucow.140
	desc = "DWCMHucow140_desc"
	picture = lacteria_research_04
	title = "dwcm_lacteria_research_title"
	
	hide_from = yes
	is_triggered_only = yes

	option = {
		name = "DWCMHucow140A" # Try to create an extract
		hidden_tooltip = { narrative_event = { id = DWCMHucow.150 days = 7 } }
	}
	option = {
		name = "DWCMHucow140B" # Later [PAUSE EVENT CHAIN]
		set_character_flag = dwcm_lacteria_search_paused_03
	}
	option = { # Not interested [STOP EVENT CHAIN]
		name = "DWCMHucow140C"
		clr_character_flag = dwcm_lacteria_research_started
		set_character_flag = dwcm_lacteria_research_aborted
		#TODO add tooltip to inform player that it will stop the event chain
	}
}


#.150 Create lactacid
narrative_event = {
  	id = DWCMHucow.150
	desc = {
		trigger = {
			NOT = { has_character_flag = dwcm_lactacid_tested_by_decision }
		}
		text = "DWCMHucow150_desc1"
	}
	desc = {
		trigger = {
			has_character_flag = dwcm_lactacid_tested_by_decision
		}
		text = "DWCMHucow150_desc2"
	}
	picture = lacteria_research_05
	title = "dwcm_lacteria_research_title"
	
	hide_from = yes
	is_triggered_only = yes

	immediate = {
		dwcm_get_lacteria_test_subject = yes
	}

	after = {
		clr_character_flag = dwcm_lactacid_tested_by_decision
	}

	option = {
		name = "DWCMHucow150A" # Drink it
		trigger = {
			is_female = yes
		}
		
		hidden_tooltip = { narrative_event = { id = DWCMHucow.160 } }
	}
	option = { # Have someone else drink it
		name = "DWCMHucow150B"
		trigger = {
			event_target:dwcm_lacteria_test_subject = { # A check to see if there was a valid character successfully slotted into the position
				character = yes
				is_alive = yes
				prisoner = no
				is_incapable = no 
				OR = {
					has_global_flag = Ala_Body_Mod
					has_dw_bodytrait_content = yes
				}
			} 
		}
		hidden_tooltip = { narrative_event = { id = DWCMHucow.180 } }
	}
	option = {
		name = "DWCMHucow150C" # use it later [PAUSE EVENT CHAIN]
		set_character_flag = dwcm_lactacid_stored
	}
}


#.160 Drink lactacid
narrative_event = { 
	id = DWCMHucow.160
  	desc = "DWCMHucow160_desc"
 	picture = lacteria_research_06
	title = "dwcm_lacteria_research_title"
	
	hide_from = yes
	is_triggered_only = yes

	option = { 
	  	name = "DWCMHucow160A"
		hidden_tooltip = { narrative_event = { id = DWCMHucow.170 days = 14 } }
 		dwcm_breast_growth = yes
 	}
}


#.170 Become a hucow
narrative_event = {
	id = DWCMHucow.170
	desc = {
		trigger = {
			is_pregnant = no
		}
		text = "DWCMHucow170_desc1"
	}
	desc = {
		trigger = {
			is_pregnant = yes
		}
		text = "DWCMHucow170_desc2"
	}  
 	picture = lacteria_research_07
	title = "dwcm_lacteria_research_title"
	
	hide_from = yes
	is_triggered_only = yes

	option = { 
	  	name = "DWCMHucow170A"
		if = {
			limit = {
				NOT = { trait = hucow }
			}
			dwcm_become_hucow = yes
		}
		hidden_tooltip = { 
			dwcm_raise_milk_production_MULTIPLIER_10 = yes
			dwcm_raise_milk_production_MULTIPLIER_10 = yes
			dwcm_update_milk_production_rate_TOTAL = yes
			set_variable = { which = dwcm_milk_quantity_CURRENT which = dwcm_milk_capacity_TOTAL }
		}
		clr_character_flag = dwcm_lacteria_research_started
		set_character_flag = dwcm_lacteria_research_completed
  	}
}


#.180 Test subject drinks lactacid
narrative_event = {
	id = DWCMHucow.180
  	desc = "DWCMHucow180_desc"
 	picture = lacteria_research_08
	title = "dwcm_lacteria_research_title"
	
	is_triggered_only = yes

	option = { 
	  	name = "DWCMHucow180A"
		hidden_tooltip = { narrative_event = { id = DWCMHucow.190 days = 14 } }
		event_target:dwcm_lacteria_test_subject = {
			dwcm_breast_growth = yes
		}
  	}
}


#.190 Test subject becomes a hucow
narrative_event = {
	id = DWCMHucow.190
  	desc = "DWCMHucow190_desc"
 	picture = lacteria_research_09
	title = "dwcm_lacteria_research_title"

	is_triggered_only = yes

	option = { 
	  	name = "DWCMHucow190A"
	  	event_target:dwcm_lacteria_test_subject = {
			if = {
				limit = {
					NOT = { trait = hucow }
				}
				dwcm_become_hucow = yes
			}
			hidden_tooltip = { 
				dwcm_raise_milk_production_MULTIPLIER_10 = yes
				dwcm_raise_milk_production_MULTIPLIER_10 = yes
				dwcm_update_milk_production_rate_TOTAL = yes
				set_variable = { which = dwcm_milk_quantity_CURRENT which = dwcm_milk_capacity_TOTAL }
			}
		}
	  	clr_character_flag = dwcm_lacteria_research_started
		set_character_flag = dwcm_lacteria_research_completed
  	}
}